/*
 Navicat Premium Data Transfer

 Source Server         : sql server
 Source Server Type    : SQL Server
 Source Server Version : 16001135 (16.00.1135)
 Source Catalog        : Graduate Admission System
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 16001135 (16.00.1135)
 File Encoding         : 65001

 Date: 06/12/2024 21:50:11
*/


-- ----------------------------
-- Table structure for auth_user_groups
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[auth_user_groups]') AND type IN ('U'))
	DROP TABLE [dbo].[auth_user_groups]
GO

CREATE TABLE [dbo].[auth_user_groups] (
  [id] bigint  IDENTITY(1,1) NOT NULL,
  [user_id] int  NOT NULL,
  [group_id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[auth_user_groups] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of auth_user_groups
-- ----------------------------
SET IDENTITY_INSERT [dbo].[auth_user_groups] ON
GO

SET IDENTITY_INSERT [dbo].[auth_user_groups] OFF
GO


-- ----------------------------
-- Auto increment value for auth_user_groups
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[auth_user_groups]', RESEED, 1)
GO


-- ----------------------------
-- Indexes structure for table auth_user_groups
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [auth_user_groups_user_id_group_id_94350c0c_uniq]
ON [dbo].[auth_user_groups] (
  [user_id] ASC,
  [group_id] ASC
)
WHERE ([user_id] IS NOT NULL AND [group_id] IS NOT NULL)
GO

CREATE NONCLUSTERED INDEX [auth_user_groups_user_id_6a12ed8b]
ON [dbo].[auth_user_groups] (
  [user_id] ASC
)
GO

CREATE NONCLUSTERED INDEX [auth_user_groups_group_id_97559544]
ON [dbo].[auth_user_groups] (
  [group_id] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table auth_user_groups
-- ----------------------------
ALTER TABLE [dbo].[auth_user_groups] ADD CONSTRAINT [PK__auth_use__3213E83FD7BAFCED] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Foreign Keys structure for table auth_user_groups
-- ----------------------------
ALTER TABLE [dbo].[auth_user_groups] ADD CONSTRAINT [auth_user_groups_group_id_97559544_fk_auth_group_id] FOREIGN KEY ([group_id]) REFERENCES [dbo].[auth_group] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[auth_user_groups] ADD CONSTRAINT [auth_user_groups_user_id_6a12ed8b_fk_auth_user_id] FOREIGN KEY ([user_id]) REFERENCES [dbo].[auth_user] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

